package me.luraframework.auth.exception;

import me.luraframework.commons.exception.ErrorCode;

public enum AuthErrorCode implements ErrorCode {
    CAN_NOT_MODIFY_OTHERS_INFO(400, "不能修改他人资料"),
    MUST_START_WITH_HTTP_OR_HTTPS(400, "外链必须以http://或者https://开头"),
    CURRENT_ROLE_HAS_USER(400, "所选角色存在用户关联，请解除关联再试！"),
    CURRENT_DEPT_HAS_USER(400, "所选部门存在用户关联，请解除关联再试！"),
    CURRENT_DEPT_HAS_ROLE(400, "所选部门存在角色关联，请解除关联再试！"),
    CAN_NOT_BE_SELF_SUPER(400, "上级不能为自己"),
    ENTITY_ALREADY_EXIST(400, "实体以存在"),
    INVALID_TOKEN(403, "token无效")
    ;


    private final int status;
    private final String message;

    AuthErrorCode(int status, String message) {
        this.status = status;
        this.message = message;
    }

    @Override
    public int getStatus() {
        return this.status;
    }

    @Override
    public String getCode() {
        return this.name();
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
